import request from '@/config/axios'

// 核销记录 VO
export interface TradeVerifyRecordVO {
  id: number | string // 唯一编号
  userId: number // 用户编号
  shopId: number // 店铺编号
  bizType: string // 业务类型
  bizId: number // 业务编号
  code: string // 核销码
  staffId: number // 店员编号
  note: string // 核销说明
}

// 核销记录 API
export const TradeVerifyRecordApi = {
  // 查询核销记录分页
  getVerifyRecordPage: async (params: any) => {
    return await request.get({ url: `/trade/verify-record/page`, params })
  },

  // 查询核销记录详情
  getVerifyRecord: async (id: number) => {
    return await request.get({ url: `/trade/verify-record/get?id=` + id })
  },

  // 新增核销记录
  createVerifyRecord: async (data: TradeVerifyRecordVO) => {
    return await request.post({ url: `/trade/verify-record/create`, data })
  },

  // 修改核销记录
  updateVerifyRecord: async (data: TradeVerifyRecordVO) => {
    return await request.put({ url: `/trade/verify-record/update`, data })
  },

  // 删除核销记录
  deleteVerifyRecord: async (id: number) => {
    return await request.delete({ url: `/trade/verify-record/delete?id=` + id })
  },

  // 导出核销记录 Excel
  exportVerifyRecord: async (params) => {
    return await request.download({ url: `/trade/verify-record/export-excel`, params })
  }
}
